namespace JQuery.WebKit
{
    using System.ComponentModel;
    using System.Security.Permissions;
    using System.Web;
    using System.Web.UI;

    [TypeConverter(typeof(ExpandableObjectConverter)), AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public sealed class PagerSettings : IStateManager
    {
        private bool _isTracking;
        private StateBag _viewState = new StateBag();

        void IStateManager.LoadViewState(object state)
        {
            if (state != null)
            {
                ((IStateManager) this.ViewState).LoadViewState(state);
            }
        }

        object IStateManager.SaveViewState()
        {
            return ((IStateManager) this.ViewState).SaveViewState();
        }

        void IStateManager.TrackViewState()
        {
            this._isTracking = true;
            ((IStateManager) this.ViewState).TrackViewState();
        }

        public override string ToString()
        {
            return string.Empty;
        }

        [Category("Appearance"), NotifyParentProperty(true), Description("Current starting page. Default is 1."), DefaultValue(1)]
        public int CurrentPage
        {
            get
            {
                object obj2 = this.ViewState["CurrentPage"];
                if (obj2 == null)
                {
                    return 1;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["CurrentPage"] = value;
            }
        }

        [Description("The message that will be shown when there are no rows in the grid."), NotifyParentProperty(true), DefaultValue(""), Category("Appearance")]
        public string NoRowsMessage
        {
            get
            {
                object obj2 = this.ViewState["NoRowsMessage"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["NoRowsMessage"] = value;
            }
        }

        [NotifyParentProperty(true), Category("Appearance"), Description("The page size (number of rows per page). Default is 10."), DefaultValue(10)]
        public int PageSize
        {
            get
            {
                object obj2 = this.ViewState["PageSize"];
                if (obj2 == null)
                {
                    return 10;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["PageSize"] = value;
            }
        }

        [DefaultValue("[10,20,30]"), Category("Appearance"), Description("The page-size options in the dropdown. Should be string in square brackers, comma separated. Default is [10,20,30]."), NotifyParentProperty(true)]
        public string PageSizeOptions
        {
            get
            {
                object obj2 = this.ViewState["PageSizeOptions"];
                if (obj2 == null)
                {
                    return "[10,20,30]";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["PageSizeOptions"] = value;
            }
        }

        [Category("Appearance"), DefaultValue(""), Description("The message that is shown while the grid is paging."), NotifyParentProperty(true)]
        public string PagingMessage
        {
            get
            {
                object obj2 = this.ViewState["PagingMessage"];
                if (obj2 == null)
                {
                    return "";
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["PagingMessage"] = value;
            }
        }

        [Category("Appearance"), NotifyParentProperty(true), Description("Enables a special paging mode - paging with scrollbar (virtual scrolling). Default is false;"), DefaultValue(false)]
        public bool ScrollBarPaging
        {
            get
            {
                object obj2 = this.ViewState["ScrollBarPaging"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["ScrollBarPaging"] = value;
            }
        }

        bool IStateManager.IsTrackingViewState
        {
            get
            {
                return this._isTracking;
            }
        }

        private StateBag ViewState
        {
            get
            {
                return this._viewState;
            }
        }
    }
}

